package com.tencent.welink.api.space.object.geo;

import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * @Description: 获取指定din和subId所对应的地理对象
 * 功能描述
 * 获取指定din和subId所对应的地理对象，subId传空代表父子都返回
 * @Author: limye
 * @CreateDate: 2020-6-9
 * @Version: V1.0
 */
public class GetGeoObjectsByDinAndSubId extends WelinkOpenApi {

    private static final Logger log = LogManager.getLogger(GetGeoObjectsByDinAndSubId.class);

    public GetGeoObjectsByDinAndSubId(){
        super("/space/geo/object/getGeoObjectsByDinAndSubId",true);
    }


    @Override
    public void displayResult(String result) {
    }


    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes,true);

        //实例化对象
        GetGeoObjectsByDinAndSubId instance = new GetGeoObjectsByDinAndSubId();

        /**
         * 参数名	类型	必填	数据约束	描述
         * token	String	是	非空且长度固定128个字符	动态密钥，有效期20分钟，需重新登录
         * din	String	是		项目id，如11
         * project_id	String	否	非空	项目编号
         */

        //添加参数
        Map<String,Object> map = instance.getExtendsPara();
        map.put("din","144115194541786483");

        //执行HTTP请求及展示结果
        instance.DoHttp();
        CrontabUtil.shutdown();

    }
}
